<div class="agency-list" >

    <div id="j_items_list" >
        <foreach name="DataArt" item="ua">
            <a href="{$ua['LinkUrl']|getArtUrl=$ua['ID']}">
                <dl class="carditems_list clearfix">
                    <dt class="carditems_list_dt"><img src="{$Think.config.Car_Art_URL_IMAGE}{$ua.Images}"
                                                       width="180" height="120"></dt>
                    <dd class="carditems_list_dd"><h3 class="carditems_list_h3 pic_t_44">{$ua.Title}</h3>

                        <p class="carditems_list_op clearfix">
                            <span class="op_ico time_num left">{$ua.DateAndTime}</span><span
                                class=" num_ico right">{$ua.hits}</span></p></dd>
                </dl>
            </a>
        </foreach>
        </div>


    <div class="loading" id="getNewsMore" style="">
        <a href="javascript:void(0)" class="loading-txt">加载更多</a>
    </div>
</div>

<script src="__PUBLIC__/js/zepto.min.js"></script>
<script type="text/javascript">
    (function ($) {{

       var  page = 1;

        function getArtUrl(LinkUrl,ID){

            if(LinkUrl != "")
            {
                url = LinkUrl;
            }else{
                url = "/index.php/?m=Car&a=carart&id=" + ID ;
            }
            return url;
        }

        $('#getNewsMore').click(function () {


            $.ajax({
                type: 'POST',
                url: '/index.php/?m=CarLibrary&a=seaCarArt',
                data: { carName: '{$DataCar[0]["ClassName"]}', pageSize:'10',page:page},
                dataType: 'json',
                timeout: 3000,
                success: function(rs){

                    var data = rs.data;
                    var status = rs.status;

                    if (status == 0 ){
                        alert(rs.info);
                    }else{

                    var len = data.length, arr = [];
                    if (len < 10){
                        $('#getNewsMore').hide();
                    }

                    for (var i = 0; i < len; i++) {

                        url = getArtUrl(data[i].LinkUrl,data[i].ID);
                        arr.push('<a href = '+url+' >');
                        arr.push('<dl class="carditems_list clearfix" > ');

                        arr.push('<dt class="carditems_list_dt">');

                        arr.push('<img src="' + '{$Think.config.Car_Art_URL_IMAGE}' +data[i].Images + '" alt="" onerror="nofind();" >');
                        arr.push('</dt>');

                        arr.push('<dd class="carditems_list_dd">');
                        arr.push('<h3 class="carditems_list_h3">' + data[i].Title + '</h3> ');
                        arr.push('<p class="carditems_list_op">');
                        arr.push('<span class="op_ico time_num left">' + data[i].DateAndTime + '</span>');
                        arr.push('<span class="num_ico right">' + data[i].hits + '</span>');
                        arr.push('</p>');
                        arr.push('</dd>');

                        arr.push('</dl></a>');
                    }
                    page = page+1;

                    $('#j_items_list').last().append(arr.join(''));
                    }
                },
                error: function(xhr, type){
                    alert('访问不到服务器!')
                }
            })
        });
    }})(Zepto);
</script>